﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DTO;
using DataAccess_Layer;

namespace Business_Layer
{
    public static class Bonus_BUS
    {
        public static DataTable createBonusForCart(int bonusID, int bonusQuantity)
        {
            List<BonusDTO> result = new List<BonusDTO>();

            BonusDTO bonus = Bonus_DAC.getBonusById(bonusID);
            bonus.Total = bonusQuantity;
            result.Add(bonus);

            return result.ToDataTable<BonusDTO>();
        }
        public static DataTable createBonusForUpdate(int bonusID)
        {
            List<BonusDTO> result = new List<BonusDTO>();

            result.Add(Bonus_DAC.getBonusById(bonusID));

            return result.ToDataTable<BonusDTO>();
        }

        public static DataTable getBonusesFromProdIds(string prodIds)
        {
            return Bonus_DAC.getBonusByProdIds(prodIds).ToDataTable<BonusDTO>();
        }

        public static bool insert(BonusDTO newBonus)
        {
            return Bonus_DAC.insert(newBonus);
        }

        public static bool update(BonusDTO updatedBonus)
        {
            return Bonus_DAC.update(updatedBonus);
        }
    }
}
